package com.colbby.datahouse.db.impl;

import com.colbby.datahouse.mapper.PropertyMapping;

public class DefaultDatabasePropertyMapping implements PropertyMapping {
	
	@Override
	public String mapping(String name) {
		StringBuilder sb = new StringBuilder();
		for(int i = 0; i < name.length(); i++) {
			char c = name.charAt(i);
			if(Character.isUpperCase(c) && i != 0) {
				sb.append('_');
			}
			sb.append(Character.toLowerCase(c));
		}
		return sb.toString();
	}
}
